<!doctype html>
<html>
<head>
    <meta charset="UTF-8" />
    <title>全部订单</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Wx/css/base.css" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Wx/css/index.css" />
</head>
<body>
<div class="order">
    <div class="tabber">
        <span class="<?=$state==''?'on':''?>" onClick="window.location='__MODULE__/FarmerOrder/index/'">全部</span>
        <span class="<?=$state=='0'?'on':''?>" onClick="window.location='__MODULE__/FarmerOrder/index/state/0'">待付款</span>
        <span class="<?=$state==1?'on':''?>" onClick="window.location='__MODULE__/FarmerOrder/index/state/1'">待发货</span>
        <span class="<?=$state==2?'on':''?>" onClick="window.location='__MODULE__/FarmerOrder/index/state/2'">已发货</span>
        <span class="<?=$state==3?'on':''?>" onClick="window.location='__MODULE__/FarmerOrder/index/state/3'">已收货</span>
        <span class="<?=$state==6?'on':''?>" onClick="window.location='__MODULE__/FarmerOrder/index/state/6'">已评价</span>
    </div>
    <div class="orderlist">
        <div class="block">
            <ul>
                <volist name="wholesale_list" id="vo">
                    <li>
                        <div class="tit">
                            订单状态
                            <span>
                                <eq name="vo.state" value="2">买家已付款</eq>
                                <eq name="vo.state" value="3">等待买家付款</eq>
                                <eq name="vo.state" value="4">已发货</eq>
                                <eq name="vo.state" value="5">已收货</eq>
                                <eq name="vo.state" value="6">已评价</eq>
                            </span>
                        </div>
                        <div class="pro" onclick="window.location='__MODULE__/FarmerOrder/saleInfo/id/{$vo.id}/'">
                            <div class="pic"><img src="<?php $img=explode(',',$vo['h_imgs']);echo $img[0]; ?>"></div>
                            <div class="name">
                                <h2><b class="md">批发</b><?=msubstr($vo['title'],20)?> {$vo.u_num}<?php echo getunit($vo['unit']);?></h2>
                                <!--<p><b><img src="images/pic02.jpg"></b><i>江训才</i><em>恩施荷花村</em></p>-->
                                <h3><del>原价：￥{$vo.sg_price}</del><em>￥{$vo.price}</em><i class="qj">（10-20件）</i><b class="sl">×{$vo.num}</b></h3>
                            </div>
                        </div>
                        <div class="total">共<b>{$vo.num}</b>件商品<span>合计：<i>￥<?=$vo['num']*$vo['price']?></i></span></div>
                        <div class="button">
                            <input type="button" class="delete" value="查看订单" onclick="window.location='__MODULE__/FarmerOrder/saleInfo/id/{$vo.id}/'" style="background:#fff; border:1px #666666 solid; color:#666;" onclick="window.location='orderdetail-nh02.html'">
                                <if condition="($vo['state'] eq 2) AND ($vo['sg_state'] eq 4)">
                                    <input type="submit" onclick="window.location='__MODULE__/FarmerOrder/pfShipment/id/{$vo.id}/'" value="立即发货"/>
                                </if>
                        </div>
                    </li>
                </volist>

                <volist name="copy_list" id="vo">
                    <li>
                        <div class="tit">订单状态
                            <span>
                                <eq name="vo.copy_state" value="1">待发货</eq>
                                <eq name="vo.copy_state" value="2">已发货</eq>
                                <egt name="vo.copy_state" value="3">已收货</egt>
                            </span>
                        </div>
                        <div class="pro" onClick="window.location='__MODULE__/FarmerOrder/info/id/{$vo.copy_id}/'">
                            <div class="pic"><img src="<?php $img=explode(',',$vo['h_imgs']);echo $img[0]; ?>"/></div>
                            <div class="name">
                                <h2><b class="xc">拼团</b><?=msubstr($vo['title'],20)?> {$vo.u_num}<?php echo getunit($vo['unit']);?></h2>
                                <p><span><b>{$vo['copy_num']}</b>份</span><span style="float:right">共<b>{$vo['u_num']*$vo['copy_num']}</b><?=getunit($vo['unit'])?></span></p>
                            </div>
                        </div>
                        <div class="total">共<b>{$vo.copy_num}</b>件商品<span>合计：<i>￥<?=$vo['copy_num']*$vo['actual_price']?></i></span></div>
                        <div class="button">
                            <input type="button" class="delete" value="查看订单" style="background:#fff; border:1px #666666 solid; margin-right:10px; color:#666;" onclick="window.location='__MODULE__/FarmerOrder/info/id/{$vo.copy_id}/'">
                            <eq name="vo.copy_state" value="1">
                                <input type="submit" onclick="window.location='__MODULE__/FarmerOrder/ptShipment/id/{$vo.copy_id}/'" value="立即发货"/>
                            </eq>
                        </div>
                    </li>
                </volist>
            </ul>
        </div>


    </div>
</div>
<script type="text/javascript" src="__PUBLIC__/Wx/js/jquery-1.9.1.js"></script>
<script type="text/javascript">
    // $('.tabber span').click(function(){
    //     $(this).addClass("on").siblings().removeClass();
    //     $(".orderlist>.block").hide().eq($('.tabber span').index(this)).show();
    // });
    //发货
    // function do_send(a){
    //     $.post('__MODULE__/FarmerOrder/do_send/id/'+$(a).attr('sg_id')+'/');
    //     $(a).parent().parent().remove();
    //     location.reload();
    // }//end fun
</script>
</body>
</html>